<?
//Get page break params
$page_size		= 10;
$page_prefix	= "";
$normal_class	= "page";
$selected_class= "page_current";
$previous		= "<";
$next				= ">";
$first			= "<<";
$last				= ">>";
$break_type		= 1;//"1 => << < 1 2 [3] 4 5 > >>", "2 => < 1 2 [3] 4 5 >", "3 => 1 2 [3] 4 5", "4 => < >"
$url				= $urlType;
$obj_response	= "";
$page_space		= 2;
$page_rewrite	= $con_mod_rewrite;
$db_count		= new db_query("SELECT COUNT(*) AS count
										 FROM categories_multi, news_multi
										 WHERE cat_id = new_category_id AND cat_active = 1 AND new_active = 1 AND cat_id IN (" . $rowType["cat_all_child"] . ") AND categories_multi.lang_id = " . $lang_id);
$listing_count	= mysql_fetch_assoc($db_count->result);
$total_record	= $listing_count["count"];
$current_page	= getValue("page", "int", "GET", 1);
if($total_record % $page_size == 0) $num_of_page = $total_record / $page_size;
else $num_of_page = (int)($total_record / $page_size) + 1;
if($current_page > $num_of_page) $current_page = $num_of_page;
if($current_page < 1) $current_page = 1;
$db_count->close();
unset($db_count);
//End get page break params
$db_category	= new db_query("SELECT cat_name, new_id, new_title, new_teaser, new_picture, new_description
										 FROM categories_multi, news_multi
										 WHERE cat_id = new_category_id AND cat_active = 1 AND new_active = 1 AND cat_id IN (" . $rowType["cat_all_child"] . ") AND categories_multi.lang_id = " . $lang_id . "
										 ORDER BY new_date DESC
										 LIMIT " . ($current_page-1) * $page_size . "," . $page_size);
?>
<div class="temp_1">
	<div class="title_1"><div class="L"><div class="R"><span><?=$rowType["cat_name"]?></span></div></div></div>
	<div class="content news">
		<?
		while($row = mysql_fetch_assoc($db_category->result)){
			$altText	= htmlspecialbo($row["new_title"]);
			$link		= generate_detail_url($module, $row["cat_name"], $row["new_title"], $row["new_id"]);
			$picture	= ($row["new_picture"] != "" ? $con_root_path . "news_pictures/small_" . $row["new_picture"] : $fs_imagepath . "no_photo_small.gif");
		?>
			<div class="picture">
				<div class="fix_table">
					<table class="wrap" cellpadding="0" cellspacing="0"><tr><td><a href="<?=$link?>"><img alt="<?=$altText?>" src="<?=$picture?>" /></a></td></tr></table>
				</div>
			</div>
			<div class="data">
				<div class="title"><a href="<?=$link?>"><?=$row["new_title"]?></a></div>
				<div class="teaser"><?=cut_string($row["new_teaser"], 500, "...");?></div>
				<div class="description"><?=cut_string(strip_tags($row["new_description"]), 1000, "...");?></div>
			</div>
			<div class="clear"></div>
			<div class="break_content_line"></div>
		<?
		}// End while($row = mysql_fetch_assoc($db_category->result))
		?>
		<? if($total_record > $page_size){?><div class="page_bar"><?=generatePageBar($page_prefix, $current_page, $page_size, $total_record, $url, $normal_class, $selected_class, $previous, $next, $first, $last, $break_type, $obj_response,$page_space, $page_rewrite);?></div><? }?>
	</div>
	<div class="bottom_1"></div>
</div>
<?
$db_category->close();
unset($db_category);
?>